package com.lzc.blog.admin.controller;

import com.lzc.blog.admin.model.params.PageParam;
import com.lzc.blog.admin.pojo.Tag;
import com.lzc.blog.admin.service.TagService;
import com.lzc.blog.admin.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tags")
public class TagController {
    @Autowired
    private TagService tagService;
    @PostMapping("/tagList")
    public Result tagList(@RequestBody PageParam pageParam){
        return tagService.tagList(pageParam);
    }

    @PostMapping("/add")
    public Result tagAdd(@RequestBody Tag tag){
        return tagService.tagAdd(tag);
    }

    @DeleteMapping("/delete/{id}")
    public Result tagDelete(@PathVariable("id") int id){
        return  this.tagService.tagDelete(id);
    }

    @PutMapping("/update")
    public Result tagDelete(@RequestBody Tag tag){
        return  this.tagService.tagUpdate(tag);
    }




}
